/**
 * This class houses all logic used by the marketplace, such as price calculation.
 * @author Stanley Ayzenberg, Michelle Partogi, Adam Perez, Araya Zaesim
 * @version 1.0
 */

public class Marketplace {

	/**
	 * Calculates price of a good in the marketplace based on its base price, IPL,
	 * the current tech level, minimum tech level, and variance factor
	 * @param BASEPRICE The good's base price
	 * @param IPL The good's price increase per tech level
	 * @param TECHLEVEL The tech level of the current system
	 * @param MTLP Minimum Tech Level to Produce this good
	 * @param VAR The good's variance factor
	 * @return The price of the good
	 */
	public static int calcPrice(int BASEPRICE, int IPL, int TECHLEVEL, int MTLP, int VAR) {
		return BASEPRICE + (IPL * (TECHLEVEL - MTLP)) + VAR;
	}
	
	/**
	 * Calculates price of a good from a trader based on its base price, IPL,
	 * the current tech level, minimum tech level, and variance factor
	 * @param BASEPRICE The good's base price
	 * @param IPL The good's price increase per tech level
	 * @param TECHLEVEL The tech level of the current system
	 * @param MTLP Minimum Tech Level to Produce this good
	 * @param VAR The good's variance factor
	 * @return The price of the good
	 */
	public static int calcTraderPrice(int BASEPRICE, int IPL, int TECHLEVEL, int MTLP, int VAR) {
		return BASEPRICE + (IPL * (TECHLEVEL - MTLP)) + VAR;
	}
}
